Having examined the former room thoroughly, you take the candle and leave. As you pass the threshold back into the hallway, the door shuts on its own, and you hear it lock.

With the brighter light of the candle, you can

examine the room on the right,
go down the hallway to the door on the end,
or take your chances and examine the keyhole on the left, in case you can see who or what locked it.